package edu.pku.taas.hyperic.types2;

import java.sql.ResultSet;
import java.sql.SQLException;

public class MetricDataPointBuilder {
	
	static class  MetricDataTable {
		public static final String TIMESTAMP = "TIMESTAMP";
		public static final String MEASUREMENT_ID = "MEASUREMENT_ID";
		public static final String VALUE = "VALUE";
	}

	
	
	public static  MetricDataPoint BuildMetricDataPoint(ResultSet rs) throws SQLException {
		MetricDataPoint mdp = new MetricDataPoint();
		mdp.setMeasurementId(rs.getInt(MetricDataTable.MEASUREMENT_ID));
		mdp.setTimestamp(rs.getLong(MetricDataTable.TIMESTAMP));
		mdp.setValue(rs.getFloat(MetricDataTable.VALUE));
		
		return mdp;
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
